<%--
    Document   : main
    Created on : 2013-4-9, 8:40:11
    Author     : piaohao
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html>
<html>
    <head>
        <base href="<%= basePath%>"/>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="common.jsp" %>
        <script type="text/javascript" src="resource/js/app/view/BottomBar.js"></script>
        <script type="text/javascript" src="resource/js/jquery-1.9.1.min.js"></script>
        <title>道路客运安全管理系统</title>
        <script>
            Ext.onReady(function() {
                var store = Ext.create('Ext.data.TreeStore', {
                    root: {
                        expanded: true,
                        children: [
                            {text: "规章制度", expanded: true, iconCls: "rule",
                                children: [
                                    {text: "政策展现", leaf: true, iconCls: "function", url: "policy/"},
                                    {text: "规章制度", leaf: true, iconCls: "function", url: "rule/"}
                                ]},
                            {text: "安全保障", expanded: true, iconCls: "safe",
                                children: [
                                    {text: "机构管理", leaf: true, iconCls: "function", url: "org/"},
                                    {text: "文件管理", leaf: true, iconCls: "function", url: "doc/"}
                                ]},
                            {text: "过程管理", expanded: true, iconCls: "process",
                                children: [
                                    {text: "驾驶员档案", leaf: true, iconCls: "function", url: "driver/"},
                                    {text: "车辆档案", leaf: true, iconCls: "function", url: "vehicle/"},
                                    {text: "线路档案", leaf: true, iconCls: "function", url: "line/"}
                                ]},
                            {text: "预警管理", expanded: true, iconCls: "warn",
                                children: [
                                    {text: "预警设置", leaf: true, iconCls: "function", url: "warn/setting"},
                                    {text: "预警处理", leaf: true, iconCls: "function", url: "warn/index"}
                                ]},
                            {text: "统计分析", expanded: true, iconCls: "chart",
                                children: [
                                    {text: "驾驶员统计", leaf: true, iconCls: "function", url: "statistic/driver"},
                                    {text: "营运车辆统计", leaf: true, iconCls: "function", url: "statistic/vehicle"}
                                ]}
                        ]
                    }
                });

                var sysMenu = Ext.create('Ext.tree.Panel', {
                    store: store,
                    width: 200,
                    height: 600,
                    scroll: "both",
                    rootVisible: false,
                    listeners: {
                        itemclick: function(view, record) {
                            if (record.data.leaf) {
                                var html = "<iframe id='centerFrm' width='100%' height='100%' frameborder='0' src='" + record.raw.url + "'></iframe>";
                                Ext.getCmp("centerPanel").update(html);
                            }
                        }
                    }
                });
                var viewport = Ext.create("Ext.Viewport", {
                    layout: {type: "border"},
                    items: [
                        {region: "north", height: 80, html: "<iframe width='100%' height='100%' src='/pages/main/top.jsp' scrolling='no' frameborder='0'></iframe>"},
                        {region: "west", title: '系统功能列表', animCollapse: true, collapsed: false, collapsible: true, width: 200, layout: {type: "border"}, items: [sysMenu]},
                        {region: "south", items: [{xtype: "bottombar"}]},
                        {region: "center", id: "centerPanel", html: "<iframe id='centerFrm' width='100%' height='100%' frameborder='0' src='/pages/main/desktop.jsp'></iframe>"}
                    ]
                });
            });
        </script>
    </head>
    <body>
    </body>
</html>
